﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxEditors;

public partial class admin_capnhatngaydien : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        load();
    }
    LichDien ld = new LichDien();
    private void load()
    {
        ASPxGridView2.DataSource = LichDien.ViewAll();
        ASPxGridView2.DataBind();
    }
    protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxTextBox mald = (ASPxTextBox)ASPxGridView2.FindEditFormTemplateControl("ASPxTextBox1");
        ASPxTextBox songaycapnhat = (ASPxTextBox)ASPxGridView2.FindEditFormTemplateControl("ASPxTextBox2");
        ld.updateLichdien(int.Parse(songaycapnhat.Text),int.Parse(mald.Text));
        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        load();
    }
}